// UserPublish 组件的样式文件
// 用户作品发布组件 - 提供完整的视频发布功能，包括文件上传、表单填写、隐私设置等

// 导入主题配置文件，包含颜色、字体等全局样式变量
import {theme} from "../../common/theme.js";

// 导出用户发布组件的CSS样式
export const css = `
    /* 组件宿主元素样式 - 设置为行内块元素 */
    :host {
        display: inline-block;
    }

    /* 用户发布容器 - 固定定位在页面顶部左侧，高层级显示 */
    .user-publish-container {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1000;
    }

    /* 发布触发按钮 - 自定义主色调为蓝色系 */
    .publish-trigger-btn {
        --sl-color-primary-600: #60a5fa;
        --sl-color-primary-700: #3b82f6;
    }

    /* 发布模态框背景层 - 全屏覆盖，带毛玻璃效果和居中布局 */
    .publish-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(8px);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        padding: 2rem 1rem;
    }

    /* 模态框显示状态 - 完全可见 */
    .publish-modal.show {
        opacity: 1;
        visibility: visible;
    }

    /* 发布表单容器 - 主要的发布界面卡片，包含阴影、圆角和动画效果 */
    .publish-form-container {
        background: ${theme.bgc};
        border-radius: 16px;
        padding: 2rem 2.5rem;
        width: 500px;
        max-width: 90vw;
        max-height: 90vh;
        overflow-y: auto;
        box-shadow:
            0 25px 50px -12px rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(255, 255, 255, 0.05);
        transform: scale(0.9) translateY(-20px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* 表单容器显示动画 - 缩放和位移到正常状态 */
    .publish-modal.show .publish-form-container {
        transform: scale(1) translateY(0);
    }

    /* 关闭按钮 - 位于表单右上角，带毛玻璃背景效果 */
    .close-btn {
        position: absolute;
        top: 1.25rem;
        right: 1.25rem;
        --sl-color-neutral-600: rgba(255, 255, 255, 0.6);
        --sl-color-neutral-700: rgba(255, 255, 255, 0.8);
        z-index: 10;
    }

    /* 关闭按钮基础样式 - 半透明背景和毛玻璃效果 */
    .close-btn::part(base) {
        color: rgba(255, 255, 255, 0.6);
        transition: all 0.2s ease;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(10px);
    }

    /* 关闭按钮悬停效果 - 增强可见度和轻微缩放 */
    .close-btn:hover::part(base) {
        color: rgba(255, 255, 255, 0.9);
        background: rgba(255, 255, 255, 0.1);
        transform: scale(1.05);
    }

    /* 发布页面头部区域 - 标题和副标题的容器 */
    .publish-header {
        text-align: center;
        margin-bottom: 2.5rem;
        padding-top: 0.5rem;
    }

    /* 发布页面主标题 - 渐变文字效果 */
    .publish-title {
        font-size: 2rem;
        font-weight: 700;
        color: ${theme.tc};
        margin: 0 0 0.5rem 0;
        background: linear-gradient(135deg, #ffffff, #e5e7eb);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    /* 发布页面副标题 - 描述性文字 */
    .publish-subtitle {
        font-size: 1rem;
        color: rgba(255, 255, 255, 0.65);
        margin: 0;
        font-weight: 400;
    }



    /* 发布表单样式 - 垂直布局的表单容器 */
    .publish-form {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }



    /* ===== 表单区域布局 ===== */
    .form-section {
        margin-bottom: 3rem;
        padding: 1.5rem;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(10px);
    }

    .form-section.basic-info {
        background: rgba(96, 165, 250, 0.03);
        border-color: rgba(96, 165, 250, 0.1);
    }

    .form-section.media-upload {
        background: rgba(168, 85, 247, 0.03);
        border-color: rgba(168, 85, 247, 0.1);
    }

    /* ===== 表单组容器 ===== */
    .form-group {
        margin-bottom: 2rem;
        position: relative;
    }

    .form-group:last-child {
        margin-bottom: 0;
    }

    /* ===== 表单标签样式 ===== */
    .form-label {
        display: block;
        font-size: 1rem;
        font-weight: 600;
        color: ${theme.tc};
        margin-bottom: 0.75rem;
        letter-spacing: 0.025em;
        position: relative;
        padding-left: 0.5rem;
    }

    .form-label.required::before {
        content: '*';
        color: #ef4444;
        font-weight: bold;
        margin-right: 0.25rem;
    }

    .form-label::after {
        content: '';
        position: absolute;
        bottom: -4px;
        left: 0.5rem;
        width: 30px;
        height: 2px;
        background: linear-gradient(90deg, #60a5fa, #3b82f6);
        border-radius: 1px;
    }



    /* ===== 输入框通用样式 ===== */
    .publish-input {
        width: 100%;
        --sl-input-border-color: rgba(255, 255, 255, 0.15);
        --sl-input-border-color-hover: rgba(255, 255, 255, 0.25);
        --sl-input-border-color-focus: #60a5fa;
        --sl-input-background-color: rgba(17, 17, 17, 0.3);
        --sl-input-color: #ffffff;
        --sl-input-placeholder-color: rgba(255, 255, 255, 0.4);
        --sl-input-font-size: 1rem;
        --sl-input-border-radius-medium: 10px;
        --sl-input-height-medium: 48px;
        --sl-spacing-small: 0.75rem;
        --sl-spacing-medium: 1rem;
    }

    .publish-input::part(base) {
        border-radius: 10px;
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
        font-size: 0.95rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .publish-input::part(input) {
        color: #ffffff;
        font-weight: 400;
    }

    .publish-input::part(prefix) {
        padding-left: 0.75rem;
        padding-right: 0.5rem;
        margin-right: 0;
    }

    .publish-input sl-icon {
        font-size: 1rem;
        color: rgba(255, 255, 255, 0.6);
        margin-right: 0.5rem;
        vertical-align: middle;
        transition: color 0.2s ease;
    }

    .publish-input:focus-within sl-icon {
        color: #60a5fa;
    }

    /* ===== 特定输入框样式 ===== */
    .title-input {
        --sl-input-height-medium: 52px;
        font-weight: 500;
    }

    .tags-input {
        --sl-input-height-medium: 50px;
    }

    .music-name-field {
        margin-bottom: 1rem;
    }

    /* ===== 文本域样式 ===== */
    .publish-textarea {
        width: 100%;
        --sl-textarea-border-color: rgba(255, 255, 255, 0.15);
        --sl-textarea-border-color-hover: rgba(255, 255, 255, 0.25);
        --sl-textarea-border-color-focus: #60a5fa;
        --sl-textarea-background-color: rgba(17, 17, 17, 0.3);
        --sl-textarea-color: #ffffff;
        --sl-textarea-placeholder-color: rgba(255, 255, 255, 0.4);
        --sl-textarea-border-radius-medium: 10px;
        --sl-spacing-small: 0.75rem;
        --sl-spacing-medium: 1rem;
    }

    .publish-textarea::part(base) {
        border-radius: 10px;
        transition: all 0.3s ease;
        backdrop-filter: blur(15px);
        background: rgba(17, 17, 17, 0.3) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .publish-textarea::part(textarea) {
        color: #ffffff;
        font-size: 0.95rem;
        line-height: 1.6;
        font-weight: 400;
    }

    /* ===== 输入辅助信息 ===== */
    .input-helper {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 0.5rem;
        font-size: 0.85rem;
    }

    .char-count {
        color: rgba(255, 255, 255, 0.7);
        font-weight: 500;
        background: rgba(255, 255, 255, 0.05);
        padding: 0.25rem 0.5rem;
        border-radius: 6px;
        margin-left: auto;
    }

    .input-tip {
        color: rgba(255, 255, 255, 0.5);
        font-style: italic;
    }

    /* ===== 上传容器 ===== */
    .upload-container {
        position: relative;
        width: 100%;
    }

    /* ===== 上传区域样式 ===== */
    .upload-area {
        border: 2px dashed rgba(255, 255, 255, 0.3);
        border-radius: 12px;
        padding: 0;
        text-align: center;
        background: rgba(255, 255, 255, 0.03);
        transition: all 0.3s ease;
        cursor: pointer;
        position: relative;
        overflow: hidden;
        min-height: 120px;
        backdrop-filter: blur(5px);
    }

    .upload-content {
        padding: 2rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 120px;
    }

    .upload-area:hover {
        border-color: rgba(96, 165, 250, 0.5);
        background: rgba(96, 165, 250, 0.05);
        transform: translateY(-2px);
    }

    .upload-area.drag-over {
        border-color: #60a5fa;
        background: rgba(96, 165, 250, 0.1);
        transform: scale(1.02);
    }

    /* ===== 特定上传区域样式 ===== */
    .video-upload {
        border-color: rgba(34, 197, 94, 0.4);
        background: rgba(34, 197, 94, 0.02);
    }

    .video-upload:hover {
        border-color: rgba(34, 197, 94, 0.6);
        background: rgba(34, 197, 94, 0.05);
    }

    .cover-upload {
        border-color: rgba(168, 85, 247, 0.4);
        background: rgba(168, 85, 247, 0.02);
    }

    .cover-upload:hover {
        border-color: rgba(168, 85, 247, 0.6);
        background: rgba(168, 85, 247, 0.05);
    }

    .music-upload {
        border-color: rgba(245, 158, 11, 0.4);
        background: rgba(245, 158, 11, 0.02);
        min-height: 100px;
    }

    .music-upload:hover {
        border-color: rgba(245, 158, 11, 0.6);
        background: rgba(245, 158, 11, 0.05);
    }

    .music-upload .upload-content {
        min-height: 100px;
        padding: 1.5rem;
    }

    /* 上传图标样式 */
    .upload-icon {
        font-size: 2.5rem;
        color: rgba(255, 255, 255, 0.4);
        margin-bottom: 1rem;
        display: block;
    }



    /* 上传提示文字 */
    .upload-text {
        font-size: 1rem;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.8);
        margin: 0 0 0.5rem 0;
    }

    /* 上传提示说明 */
    .upload-hint {
        font-size: 0.85rem;
        color: rgba(255, 255, 255, 0.5);
        margin: 0;
    }



    /* 封面上传区域特殊样式 */
    .cover-upload {
        min-height: 120px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    /* 音乐上传区域特殊样式 */
    .music-upload {
        margin-top: 1rem;
        min-height: 100px;
    }

    /* 音乐名称输入框样式 */
    .music-name {
        margin-bottom: 1rem;
    }

    /* 文件预览容器 */
    .file-preview,
    .image-preview,
    .music-preview {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 1rem;
    }

    /* 预览图片样式 */
    .preview-image {
        width: 80px;
        height: 45px;
        object-fit: cover;
        border-radius: 6px;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    /* 文件名显示 */
    .file-name,
    .music-file-name {
        flex: 1;
        color: rgba(255, 255, 255, 0.9);
        font-size: 0.9rem;
        font-weight: 500;
    }

    /* 音乐信息容器 */
    .music-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    /* 音乐时长显示 */
    .music-duration {
        font-size: 0.8rem;
        color: rgba(255, 255, 255, 0.6);
    }

    /* 移除文件按钮 */
    .remove-file,
    .remove-image,
    .remove-music {
        --sl-color-neutral-600: rgba(255, 255, 255, 0.6);
        --sl-color-neutral-700: rgba(255, 255, 255, 0.8);
    }

    /* 标签预览容器 */
    .tags-preview {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.75rem;
    }

    /* 标签样式 */
    .tag-item {
        background: rgba(96, 165, 250, 0.2);
        color: #93c5fd;
        padding: 0.25rem 0.75rem;
        border-radius: 20px;
        font-size: 0.8rem;
        font-weight: 500;
        border: 1px solid rgba(96, 165, 250, 0.3);
    }

    /* 隐私选项样式 */
    .privacy-options {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        --sl-color-primary-600: #60a5fa;
    }



    /* 单选按钮样式 */
    .privacy-options sl-radio {
        --sl-color-neutral-600: rgba(255, 255, 255, 0.7);
        --sl-color-neutral-700: rgba(255, 255, 255, 0.9);
        --sl-radio-size: 16px;
        padding: 0.5rem 0.75rem;
        border-radius: 6px;
        background: transparent;
        border: 1px solid rgba(255, 255, 255, 0.08);
        transition: all 0.2s ease;
        font-size: 0.9rem;
    }

    /* 单选按钮悬停效果 */
    .privacy-options sl-radio:hover {
        background: rgba(255, 255, 255, 0.03);
        border-color: rgba(96, 165, 250, 0.3);
        transform: translateX(2px);
    }

    /* 复选框样式 */
    sl-checkbox {
        --sl-color-primary-600: #60a5fa;
        --sl-color-neutral-600: rgba(255, 255, 255, 0.7);
        margin-bottom: 0.75rem;
        padding: 0.5rem 0;
    }

    /* 发布操作按钮容器 */
    .publish-actions {
        display: flex;
        justify-content: center;
        gap: 1rem;
        margin-top: 2.5rem;
        padding-top: 2rem;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        position: relative;
    }

    .publish-actions::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 60px;
        height: 1px;
        background: linear-gradient(90deg, transparent, #60a5fa, transparent);
    }

    /* 草稿按钮样式 */
    .draft-btn {
        flex: 1;
        --sl-color-neutral-600: rgba(255, 255, 255, 0.7);
        --sl-color-neutral-700: rgba(255, 255, 255, 0.9);
        --sl-button-font-weight: 600;
    }

    /* 草稿按钮基础样式 */
    .draft-btn::part(base) {
        border-radius: 10px;
        height: 48px;
        font-size: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.2);
        background: rgba(255, 255, 255, 0.05);
        color: rgba(255, 255, 255, 0.8);
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
    }



    /* 草稿按钮悬停效果 */
    .draft-btn:hover::part(base) {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.3);
        transform: translateY(-1px);
    }

    /* 发布按钮样式 */
    .publish-btn {
        flex: 2;
        --sl-color-primary-600: #60a5fa;
        --sl-color-primary-700: #3b82f6;
        --sl-button-font-weight: 600;
    }

    /* 发布按钮基础样式 */
    .publish-btn::part(base) {
        border-radius: 10px;
        height: 48px;
        font-size: 1rem;
        background: linear-gradient(135deg, #60a5fa, #3b82f6);
        border: none;
        box-shadow: 0 4px 15px rgba(96, 165, 250, 0.3);
        transition: all 0.3s ease;
    }

    /* 发布按钮悬停效果 */
    .publish-btn:hover::part(base) {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(96, 165, 250, 0.4);
    }

    /* 按钮图标样式 */
    .draft-btn sl-icon,
    .publish-btn sl-icon {
        font-size: 1rem;
        margin-right: 0.5rem;
        vertical-align: middle;
    }

    /* 错误消息样式 */
    .error-message {
        color: #fca5a5;
        font-size: 0.8rem;
        margin-top: 0.5rem;
        min-height: 1.2rem;
        padding: 0.25rem 0.5rem;
        background: rgba(248, 113, 113, 0.1);
        border-radius: 6px;
        border-left: 3px solid #f87171;
        display: none;
    }

    /* 错误消息显示状态 */
    .error-message.show {
        display: block;
    }

    /* 加载状态样式 */
    .loading {
        pointer-events: none;
        opacity: 0.7;
    }

    /* 大屏幕优化 (1440px+) */
    @media (min-width: 1440px) {
        .publish-form-container {
            width: 600px;
            padding: 3rem;
        }

        .publish-form {
            gap: 2rem;
        }
    }

    /* 中等屏幕 (1024px - 1439px) */
    @media (min-width: 1024px) and (max-width: 1439px) {
        .publish-form-container {
            width: 550px;
            padding: 2.5rem;
        }
    }

    /* 响应式设计 - 平板设备适配 (768px以下) */
    @media (max-width: 1023px) {
        .publish-form-container {
            padding: 2rem;
            width: 95vw;
            margin: 1rem;
        }

        .publish-title {
            font-size: 1.75rem;
        }

        .publish-subtitle {
            font-size: 0.9rem;
        }

        .upload-area {
            padding: 1.5rem;
        }

        .upload-icon {
            font-size: 2rem;
        }

        .publish-actions {
            flex-direction: column;
        }

        .draft-btn,
        .publish-btn {
            flex: 1;
        }
    }

    /* 移动端响应式设计 - 小屏幕设备优化 */
    @media (max-width: 768px) {
        .publish-form-container {
            padding: 2rem;
            width: 95vw;
            margin: 1rem;
        }

        .publish-title {
            font-size: 1.5rem;
        }

        .publish-subtitle {
            font-size: 0.85rem;
        }

        .form-group {
            margin-bottom: 1.25rem;
        }

        .form-label {
            font-size: 0.85rem;
            margin-bottom: 0.5rem;
        }

        .publish-actions {
            flex-direction: column;
            gap: 0.75rem;
        }

        .upload-area {
            min-height: 100px;
            padding: 1.5rem;
        }

        .upload-icon {
            font-size: 2rem;
            margin-bottom: 0.75rem;
        }

        .upload-text {
            font-size: 0.9rem;
            margin-bottom: 0.5rem;
        }

        .upload-hint {
            font-size: 0.8rem;
        }

        .cover-upload, .music-upload {
            min-height: 80px;
            padding: 1rem;
        }

        .privacy-options {
            flex-direction: column;
            gap: 0.5rem;
        }
    }

    /* 响应式设计 - 移动设备适配 (480px以下) */
    @media (max-width: 480px) {
        .publish-modal {
            padding: 1rem;
        }

        .publish-form-container {
            padding: 1.5rem;
            width: 95vw;
            border-radius: 12px;
        }

        .publish-title {
            font-size: 1.25rem;
        }

        .publish-subtitle {
            font-size: 0.85rem;
        }

        .form-group {
            margin-bottom: 1.5rem;
        }

        .form-label {
            font-size: 0.8rem;
            margin-bottom: 0.5rem;
        }

        .upload-area {
            min-height: 80px;
            padding: 1rem;
        }

        .upload-icon {
            font-size: 1.5rem;
            margin-bottom: 0.5rem;
        }

        .upload-text {
            font-size: 0.8rem;
            margin-bottom: 0.25rem;
        }

        .upload-hint {
            font-size: 0.7rem;
        }

        .cover-upload, .music-upload {
            min-height: 60px;
            padding: 0.75rem;
        }

        .privacy-options {
            flex-direction: column;
            gap: 0.4rem;
        }

        .privacy-options sl-radio {
            padding: 0.4rem 0.6rem;
            font-size: 0.85rem;
        }

        .publish-actions {
            gap: 1rem;
        }
    }

    /* 暗色主题适配 - 系统暗色模式下的样式调整 */
    @media (prefers-color-scheme: dark) {
        .publish-modal {
            background: rgba(0, 0, 0, 0.9);
        }

        .publish-form-container {
            box-shadow:
                0 25px 50px -12px rgba(0, 0, 0, 0.7),
                0 0 0 1px rgba(255, 255, 255, 0.08);
        }
    }

    /* 动画关键帧 - 淡入向上动画 */
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* 表单容器显示动画 */
    .publish-modal.show .publish-form-container {
        animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* 文件拖拽动画 */
    @keyframes dragPulse {
        0%, 100% {
            transform: scale(1);
        }
        50% {
            transform: scale(1.02);
        }
    }

    /* 拖拽状态动画 */
    .upload-area.drag-over {
        animation: dragPulse 1s ease-in-out infinite;
    }
`;


